{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_cjdianc/template/public/ygcss.css">
<style type="text/css">
    .form-horizontal .control-label{text-align: left;}
    .ygmargin{margin-top: 10px;color: #999;}
    input[type="radio"] + label::before {
        content: "\a0"; /*不换行空格*/
        display: inline-block;
        vertical-align: middle;
        font-size: 16px;
        width: 1em;
        height: 1em;
        margin-right: .4em;
        border-radius: 50%;
        border: 2px solid #ddd;
        text-indent: .15em;
        line-height: 1; 
    }
    input[type="radio"]:checked + label::before {
        background-color: #44ABF7;
        background-clip: content-box;
        padding: .1em;
        border: 2px solid #44ABF7;
    }
    input[type="radio"] {
        position: absolute;
        clip: rect(0, 0, 0, 0);
    }
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li class="active"><a href="javascript:void(0);">配送设置</a></li>
</ul>
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="invitative">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                配送设置
            </div>
            <div class="panel-body">
             <div class="form-group">
                <label class="col-sm-offset-1 col-sm-1 control-label">外卖配送</label>
                <div class="col-sm-9">
                    <label class="radio-inline">
                        <input type="radio" id="emailwy5" name="is_ps" value="1" {if $info['is_ps']==1}checked{/if} />
                        <label for="emailwy5">开启</label>
                    </label>
                    <label class="radio-inline">
                        <input type="radio" id="emailwy6" name="is_ps" value="2" {if $info['is_ps']==2 || empty($info['is_ps'])}checked{/if} />
                        <label for="emailwy6">关闭</label>
                    </label>
                    <div class="ygmargin">*用户下订单时是否有外卖配送按钮选项</div>
                </div>

            </div>
            <div class="form-group">
              <label class="col-sm-offset-1 col-sm-1 control-label">到店自提</label>
              <div class="col-sm-9">
                <label class="radio-inline">
                    <input type="radio" id="emailwy1" name="is_zt" value="1" {if $info['is_zt']==1}checked{/if} />
                    <label for="emailwy1">开启</label>
                </label>
                <label class="radio-inline">
                    <input type="radio" id="emailwy2" name="is_zt" value="2" {if $info['is_zt']==2 || empty($info['is_zt'])}checked{/if} />
                    <label for="emailwy2">关闭</label>
                </label>
                <div class="ygmargin">*用户下订单时是否有到店自提按钮选项</div>
            </div>

        </div>
        <div class="form-group">
            <label class="col-sm-offset-1 col-sm-1 control-label">餐具用量</label>
            <div class="col-sm-9">
                <label class="radio-inline">
                    <input type="radio" id="emailwy7" name="is_cj" value="1" {if $info['is_cj']==1}checked{/if} />
                    <label for="emailwy7">开启</label>
                </label>
                <label class="radio-inline">
                    <input type="radio" id="emailwy8" name="is_cj" value="2" {if $info['is_cj']==2 || empty($info['is_cj'])}checked{/if} />
                    <label for="emailwy8">关闭</label>
                </label>
                <div class="ygmargin">*用户下订单时是否有餐具用量按钮选项</div>
            </div>

        </div>
        <div class="form-group">
          <label class="col-sm-offset-1 col-sm-1 control-label">货到付款</label>
          <div class="col-sm-9">
            <label class="radio-inline">
                <input type="radio" id="emailwy3" name="is_hdfk" value="1" {if $info['is_hdfk']==1}checked{/if} />
                <label for="emailwy3">开启</label>
            </label>
            <label class="radio-inline">
                <input type="radio" id="emailwy4" name="is_hdfk" value="2" {if $info['is_hdfk']==2 || empty($info['is_hdfk'])}checked{/if} />
                <label for="emailwy4">关闭</label>
            </label>
            <div class="ygmargin">*用户下订单时是否有货到付款按钮选项</div>
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-offset-1 col-sm-1 control-label">配送时间</label>
        <div class="col-sm-10">
            <input type="text" name="ps_time" value="{$info['ps_time']}" class="form-control" id="inputEmail3"
            placeholder="请填写配送时间">
            <div class="ygmargin">*例如 : 30分钟</div>
        </div>
    </div>
    <div class="form-group">
        <label for="inputEmail3" class="col-sm-offset-1 col-sm-1 control-label">配送方式</label>
        <div class="col-sm-10">
            <select class="form-control" name="ps_mode">                    
                {if $sys['is_sj']==1}
                <option value="商家配送" {if $info['ps_mode']=='商家配送' }selected{/if}>商家配送</option>
                {/if}
                {if $sys['is_dada']==1}
                <option value="达达配送" {if $info['ps_mode']=='达达配送' }selected{/if} >达达配送</option>
                {/if}
                {if $sys['is_kfw']==1}
                <option value="快服务配送" {if $info['ps_mode']=='快服务配送' }selected{/if}>快服务配送</option>
                {/if}
                {if $sys['is_pt']==1}
                <option value="{$ps_name}" {if $info['ps_mode']==$ps_name }selected{/if}>{$ps_name}</option>
                {/if}

            </select>
            <div class="ygmargin">选择{$ps_name}配送,请确保安装跑腿小程序并在跑腿小程序中绑定此小程序</div>

        </div>
    </div>
    <div class="form-group dada">
        <label class="col-sm-offset-1 col-sm-1 control-label">达达key</label>
        <div class="col-sm-10">
           <input type="text" onkeyup="value=value.replace(/[^\d.]/g,'')" name="source_id" value="{$dadainfo['source_id']}" id="web_name" class="form-control" />
           <div class="ygmargin">*请去http://newopen.imdada.cn申请</div>
       </div>
   </div> 
   <div class="form-group dada">
    <label class="col-sm-offset-1 col-sm-1 control-label">达达secret</label>
    <div class="col-sm-10">
       <input type="text"  name="shop_no" value="{$dadainfo['shop_no']}" id="web_name" class="form-control" />
       <div class="ygmargin">*请去http://newopen.imdada.cn申请</div>
   </div>
</div> 
<div class="form-group kfw">
    <label class="col-sm-offset-1 col-sm-1 control-label">商户ID(user_id)</label>
    <div class="col-sm-10">
        <input type="text" name="user_id" class="form-control" value="{$kfwinfo['user_id']}" />
    </div>
</div> 
<div class="form-group">
    <label class="col-sm-offset-1 col-sm-1 control-label">配送距离设置</label>
    <div class="col-sm-10">
       <input type="number" name="ps_jl" value="{$info['ps_jl']}" class="form-control" id="inputEmail3"
       placeholder="请填写配送的最大距离,单位千米">
       <div class="ygmargin">*单位为:公里(千米)</div>
   </div>
</div> 
<div class="form-group">
    <label class="col-sm-offset-1 col-sm-1 control-label">到店自提协议</label>
    <div class="col-sm-9">
       {php echo tpl_ueditor('ztxy',$info['ztxy']);}
   </div>
</div>

</div>
</div>
<div class="form-group">
    <input type="submit" name="submit" value="保存设置" class="btn col-xs-3" style="color: white;background-color: #44ABF7;" />
    <input type="hidden" name="token" value="{$_W['token']}" />
    <input type="hidden" name="id" value="{$item['id']}" />
</div>
</form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-0").show();
        $("#yframe-0").addClass("wyactive");
        $("select[name=ps_mode]").bind("change",function(){
         var seleVal = $("select option:selected").val();
         console.log(seleVal)
         waiter(seleVal)
     })
        var val = $("select option:selected").val();
        waiter(val)
        function waiter(val){
        	if(val=='达达配送'){
        		$(".dada").show()
        		$(".kfw").hide()
        	}else if(val=='快服务配送'){
        		$(".dada").hide()
        		$(".kfw").show()
        	}else if(val!='达达配送'&&val!='快服务配送'){
        		$(".dada").hide()
        		$(".kfw").hide()
        	}
        }
    })
</script>
{template 'common/footer'}

